$(function(){
   var id = $("#videoId").val();
   if(id){
       $.ajax({
           type : "post",
           url : "htmlWeb/getExamplePageList",//,"payStatus" : -2
           data: {"id" : id},
           async: false,
           success : function(data){
               var str = "";
               $.each(data.rows,function(i,obj){
                   obj = trimEmpty(obj);
                   $("#videoName").val(obj.name);
                   $("#videoLink").val(obj.descn);
                   $("#preview").attr("src","http://img.boyitongcheng.com/" + obj.imgUrl);
               });

           },
           error : function(data){
               console.log(data);
           }
       });
   }

    $(".save").click(function () {
        var options = {
            url: '/htmlWeb/submitExample',
            type: 'post',
            success: function (data) {
                $.ajaxSetup({cache: false});
                navPills("/htmlWeb/systemVideoListHtml");
            },
            error:function () {
                $.ajaxSetup({cache: false});
                tip("上传失败");
                navPills("/htmlWeb/systemVideoListHtml");
            }
        };
        $("#form").ajaxForm(options);
    });
});

function cancle(){
    navPills("/htmlWeb/systemVideoListHtml");
}